import {createRouter as _createRouter, createWebHistory} from 'vue-router';
// 导入 凡是想要通过路由跳转的，都需要在这：1.导入  2.注册 设置对应vue组件的路径名
import index from '../views/index.vue'
import register from '../views/register.vue'
import login from '../views/login.vue'
import findpass from '../views/find.vue'
import my from '../views/my.vue'
import main from '../views/main.vue'
import patientlist from '../views/patientlist.vue'
import addpatient from '../views/addpatient.vue'
import hospitalizedlist from '../views/hospitalizedlist.vue'
import addhospitalized from '../views/addhospitalized.vue'
import bindpatientlist from '../views/bindpatientlist.vue'
import hospitalized from '../views/hospitalized.vue'

const routes = [
    // 注册 设置对应vue组件的路径名
    { path: '/index', component: index },
    { path: '/register', component: register },
    { path: '/login', component: login },
    { path: '/find', component: findpass },
    { path: '/my', component: my },
    { path: '/', component: main },
    { path: '/patientlist', component: patientlist },
    { path: '/addpatient', component: addpatient },
    { path: '/hospitalizedlist', component: hospitalizedlist },
    { path: '/addhospitalized', component: addhospitalized },
    { path: '/bindpatientlist', component: bindpatientlist },
    { path: '/hospitalized', component: hospitalized },
]

export function createRouter() {
    return _createRouter({
        history: createWebHistory(),
        routes
    })
}
